import request from '@/utils/request'

// 课程管理
export const getSectionAndLesson = courseId => {
  return request({
    method: 'GET',
    url: `/boss/course/section/getSectionAndLesson?courseId=${courseId}`,
    params: courseId
  })
}

// 课程管理
export const getBySectionId = sectionId => {
  return request({
    method: 'GET',
    url: `/boss/course/section/getBySectionId?sectionId=${sectionId}`,
    params: sectionId
  })
}

// 添加或者编辑课程
export const saveOrUpdateSection = data => {
  return request({
    method: 'POST',
    url: '/boss/course/section/saveOrUpdateSection',
    data
  })
}

export const saveOrUpdateLesson = data => {
  return request({
    method: 'POST',
    url: '/boss/course/lesson/saveOrUpdate',
    data
  })
}

// 通过id获取详情
export const getLessonById = lessonId => {
  return request({
    method: 'GET',
    url: `/boss/course/lesson/getById?lessonId=${lessonId}`
  })
}
